<?php

/**
 * Controller administrativo.
 * @package Core
 * @subpackage Controllers
 * @category Controllers
 * @author Carlos Carvalho <contato@carlosocarvalho.com.br>
 * @version 1.0.1
 */

class User_Controller extends I_Controller{
    
    var $template = 'user';
    var $path = 'frontend/user/';
    
    public  function __construct() {
        parent::__construct();
        $exceptions_uris = array(
            BASE_URL_USER.'/login',
            BASE_URL_USER.'/autentication',
            BASE_URL_USER.'/autentication_ajax',
            BASE_URL_USER.'/reset-my-password',
            BASE_URL_USER.'/new-reset-password',
            BASE_URL_USER.'/DemoEmailMyPassword',
            BASE_URL_USER.'/changePassword',
            BASE_URL_USER.'/saveChangeMyPassword',
            BASE_URL_USER.'/sendKeyActivation'
        );

        define('USER_PAINEL', true);

        /*
        if (in_array(uri_string(), $exceptions_uris) == false) {
            if ($this->user_model->loggedin() == false) {
                redirect(BASE_URL_USER.'/login');
            }
        }*/

        
    }
    
    function template($view) {
        if(!is_array($view)):
            $view = array($view);
        endif;
        $views = array();
        foreach ($view as $v):
            $views[] = "{$this->path}{$v}";
        endforeach;
        parent::template($views);
    }
    
}